<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>EasyTalk Administrator's Control Panel</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta content="H.Joeson" name="Copyright" />
		<link rel="stylesheet" href="<{$res}>/css/style.css" type="text/css" media="all" />
		<script src="<{$res}>/js/jquery.js" type="text/javascript"></script>
		<script src="<{$res}>/js/admin.js" type="text/javascript"></script>
		<script type="text/javascript">
			$(function(){
				//增加一个上传图片的输入框
				$('#add').click(function(){
					$('#addtr').before('<tr><td><input type="file" name="top[]"><br/></td></tr>');
				});
				//删除图片
				$('#img img').click(function(){
					if(confirm('确定这么做吗？？？')){
						id = this.id;
						$.ajax({
							url:"<{$url}>/del",
							type:'post',
							data:'id='+id,
							success:function(data){
								if(data=='1'){
									$('#'+id).remove();
								}
							}
						});
					}
				});
			});
		</script>
	</head>
	<body>
		<div id="bodymain">
			<div class="title"> </div>
			<div class="content">
				<div class="infomation"><b>说明：</b>该功能只设置首页面（登录/注册页面）的幻灯片<font color='red'>(最多只显示最后上传的五张图片)</font></div><br/>
				<form action='<{$url}>/doIndexads' enctype="multipart/form-data" method="POST">
				<h3>登录/注册页面广告管理</h3>
				<table style="margin:5px 0 20px 0">
					<tr>
						<td valign="top">
							<input type="file" name="top[]"><br/>
						</td>
					</tr>
					<tr id="addtr">
						<td align="center">
							<img src="<{$res}>/images/add.png" id="add" style="margin-top:20px;"/>
						</td>
					</tr>
				</table>
				<input type="submit" class="button1 submit" value="保存提交"><br/><br/><br/>
				<div class="infomation"><b>说明：</b>点击图片删除该广告图片</div><br/>
				<h3>正在使用的广告图片</h3>
				<div style="width:100%;height:400px;" id="img">
					<{foreach $ads as $v}>
						<img id="<{$v.id}>" width="200" height="120" style="float:left;" src="<{$public}>/indeximg/<{$v['pic']}>">
					<{/foreach}>
				</div>
				</form>
			</div>
		</div>
	</body>
</html>